import moment from 'moment';
export const searchProps = [
  {
    type: 'select_input_one',
    value: 'channelId',
    name: '渠道',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '180px',
    },
  },
  {
    type: 'date3',
    value: 'time',
    name: '日期',
    selectOptions: [],
    placeholder: '请选择',
    style: {
      width: '240px',
    },
  },
];

export const columns = [
  // {
  //   title: '序号',
  //   dataIndex: 'index',
  //   width: 70,
  //   customRender: (text, record, index) => `${index + 1}`,
  // },
  // {
  //   dataIndex: 'channelId',
  //   title: '渠道ID',
  //   ellipsis: true,
  //   width: 150,
  //   customRender: (text) => text || '/',
  // },
  {
    dataIndex: 'channelName',
    title: '渠道名称',
    ellipsis: true,
    width: 120,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'statisticsDate',
    title: '统计时间',
    ellipsis: true,
    width: 180,
    customRender: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/',
  },
  {
    dataIndex: 'institutionApplyNumber',
    title: '机构投放个数',
    ellipsis: true,
    width: 120,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'institutionIncome',
    title: '机构收益',
    ellipsis: true,
    width: 100,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'loanApiApplyNumber',
    title: 'API进件数量',
    ellipsis: true,
    width: 120,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'loanApiIncome',
    title: 'API收益',
    ellipsis: true,
    width: 100,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'loanProductClickNumber',
    title: '产品点击数量',
    ellipsis: true,
    width: 120,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'loanProductIncome',
    title: '产品收益',
    ellipsis: true,
    width: 100,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'channelUv',
    title: 'UV',
    ellipsis: true,
    width: 60,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'channelExpenses',
    title: '渠道支出',
    ellipsis: true,
    width: 100,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'totalIncome',
    title: '总收入',
    ellipsis: true,
    width: 80,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'profit',
    title: '利润',
    ellipsis: true,
    width: 80,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
  {
    dataIndex: 'roi',
    title: 'ROI总收入/支出',
    ellipsis: true,
    width: 150,
    customRender: (text) => text === 0 ? 0 : (text || '/'),
  },
];
